const { requestHasToken } = require('../util/server');

// 添加轮播图
export const addBanner = banner => {
  return requestHasToken({
    url: '/banner/createBanner',
    data: banner,
    method: 'post'
  })
};
// 修改轮播图
export const updateBanner = banner => {
  return requestHasToken({
    url: '/banner/updateBanner',
    data: banner,
    method: 'post'
  })
};
// 修改轮播图状态
export const updateBannerStatus = (bannerId, isDefault) => {
  return requestHasToken({
    url: '/banner/updateIsDefault',
    data: {
      bannerId, isDefault
    },
    method: 'put'
  })
};
// 删除轮播图
// export const deleteBanner = bannerId => {
//   return requestHasToken({
//     url: ''
//   })
// }

// 查询轮播图
export const getBannerListByPage = query => {
  return requestHasToken({
    url: '/banner/queryBannerPage',
    method: 'post',
    data: query
  })
}




